/**
 * 双重校验锁
 *
 * @author susj
 * @date 2022年10月26日 16:01
 */
public class DoubleCheck {

    private static volatile DoubleCheck instance = null;

    private DoubleCheck() {
    }

    public static DoubleCheck getInstance() {
        if (instance == null) {
            synchronized (DoubleCheck.class) {
                if (instance == null) {
                    instance = new DoubleCheck();
                }
            }
        }
        return instance;
    }
}
